home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / mathlib.exe / SAVAGE.PAS < prev   
Pascal/Delphi Source File  |  1991-11-30  |  1KB  |  31 lines

  1. {$N+}
  2. PROGRAM Savage;
  3. { variation of the savage benchmark for floating point performance }
  4. USES    DOS, MathLib;
  5. CONST   isize = 25000;
  6. VAR     hr1,min1,sec1,hun1,hr2,min2,sec2,hun2:WORD;
  7.         i,j: INTEGER;
  8.         time: REAL;
  9.         a: DOUBLE;
  10.  
  11.   BEGIN
  12.     a := 1.0;
  13.     GetTime(hr1,min1,sec1,hun1);
  14.     FOR j := 1 TO 15 DO FOR i := 1 TO isize DO
  15.       a := TAN(ARCTAN(EXP(LN(SQRT(a*a)))))+1;
  16.     GetTime(hr2,min2,sec2,hun2);
  17.     time := 3600*(hr2-hr1)+60*(min2-min1)+(sec2-sec1-1)+(100+hun2-hun1)/100;
  18.     WRITELN('time (sec): ',time:6:2);
  19.     WRITELN('result "a": ',a);
  20.   END.
  21.   
  22. { Results with Club American 486/33 (time in seconds):
  23.  
  24.         OperatingSys    MathLib    P287MathLib   P387MathLib
  25.         ------------    --------   -----------   -----------
  26.         MS-DOS 5         36.20       22.85         19.88
  27.         w/ 386MAX 6      47.79       22.91         19.88
  28.         w/ NetRoom 2     52.01       22.90         19.88
  29.         w/ HIMEM/EMM     57.51       23.01         19.99
  30.         
  31. }